Merged
Conversation
Collaborator
|
SSH |
mgreenegit
reviewed
Jun 28, 2022
| if not os.path.isfile(rdp_path): | ||
| raise azclierror.BadRequestError("Could not find " + rdp_command + ".exe. Is the rdp client installed?") | ||
| else: | ||
| raise azclierror.BadRequestError("Platform is not supported for this command. Supported platforms: Windows") |
Member
There was a problem hiding this comment.
Could we potentially make this cross-platform by calling the address using the rdp:// protocol handler instead of calling the .exe directly?
Member
There was a problem hiding this comment.
@zhoxing-ms if we cannot make this cross-platform, is there some way to only show the parameter on Windows machines and not on Mac/Linux?
Contributor
There was a problem hiding this comment.
@jiasli Do you have any suggestions on this question?
jiasli
approved these changes
Jun 29, 2022
zhoxing-ms
reviewed
Jun 29, 2022
|
|
||
| op_call = ssh_utils.start_ssh_connection | ||
| if winrdp: | ||
| if platform.system() != 'Windows': |
Contributor
There was a problem hiding this comment.
I want to confirm with you that the judgment here does not need to ignore the case of platform.system()?
zhoxing-ms
reviewed
Jun 29, 2022
zhoxing-ms
reviewed
Jun 29, 2022
src/ssh/azext_ssh/rdp_utils.py
Outdated
Comment on lines
160
to
174
| def print_error_messages_from_log(log_list, print_ssh_logs, ssh_process, terminated): | ||
| # Read the remaining log messages since the connection was established. | ||
| next_line = ssh_process.stderr.readline() | ||
| while next_line: | ||
| if print_ssh_logs: | ||
| print(next_line, end='') | ||
| else: | ||
| log_list.append(next_line) | ||
| next_line = ssh_process.stderr.readline() | ||
|
|
||
| # If ssh process was not forced to terminate, print potential error messages. | ||
| if ssh_process.returncode != 0 and not print_ssh_logs and not terminated: | ||
| for line in log_list: | ||
| if "debug1:" not in line and line != '': | ||
| print(str(line)) |
Contributor
There was a problem hiding this comment.
print_error_messages_from_log
If you are printing the error messages, why not use the log.error?
zhoxing-ms
approved these changes
Jun 30, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new parameter --rdp/--winrdp that uses port forwarding to allow users to create RDP connections over the SSH connection created by the extension.
This is useful for costumers who want to connect to their Azure Arc Servers via RDP using the Arc Connectivity Platform.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally?For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json.